package com.guonl.utils;

import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

@Component
public class SpringEventUtil {

    private static ApplicationEventPublisher applicationEventPublisher;

    public SpringEventUtil(ApplicationEventPublisher applicationEventPublisher) {
        this.applicationEventPublisher = applicationEventPublisher;
    }

    public static <T> void sentEvent(T message) {
        applicationEventPublisher.publishEvent(message);
    }


}
